﻿/*
 *  Author: Louis A. Leskoviansky
 *  Company: Artemis Solutions Group (http://www.artemis-solutions.com)
 */


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AjaxControlFramework
{
    public abstract class BaseScriptControl : Control
    {
        //------// Properties \\--------------------------------------------\\
        private string _name = String.Empty; // default value
        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value == null)
                {
                    _name = String.Empty;
                }
                else
                {
                    _name = value;
                }
            }
        }


        protected ScriptType? _type = null; // default value
        public virtual ScriptType Type
        {
            get { return _type.Value; }
            set { _type = value; }
        }


        private string[] _dependencies = new string[0];

        [TypeConverter(typeof(StringArrayConverter))]
        public virtual string[] Dependencies
        {
            get { return _dependencies; }
            set { _dependencies = value; }
        }
        //------\\ Properties //--------------------------------------------//



        //------// Constructors \\------------------------------------------\\
        protected BaseScriptControl()
        {
            EnableViewState = false;
        }
        //------\\ Constructors //------------------------------------------//



        //------// Methods \\-----------------------------------------------\\
        public abstract void ValidateProperties();
        public abstract ScriptReference GenerateScriptReference();
        //------\\ Methods //-----------------------------------------------//
    }
}
